#!/usr/bin/python
# -*- coding: UTF-8 -*-
import xlrd
from UtilPackge import sureVarType
from UtilPackge import Logger

"""只是将数据读取出来 格式为：
{
 0: ['名称', 2.0], 
 1: ['叶秋 摆件吸管杯1', 1.0],
 2: ['叶秋 摆件吸管杯2', 2.0], 
 3: ['叶秋 摆件吸管杯3', 3.0]
 }
key为行数 value为列数的值
"""
def readExceInfo(filePath,sheetName):

    data = xlrd.open_workbook(filePath)

    table = data.sheet_by_name(sheetName)

    Exceldata = {}
    for rowNum in range(table.nrows):
        rowVale = table.row_values(rowNum)
        Exceldata[rowNum] = rowVale
    # for colNum in range(table.ncols):
    #     print(sureVarType.sureVarTypes((rowVale[colNum])))
    #     print("---------------")
    Logger.logger.info("读取Excel中的数据为："+str(Exceldata))
    return Exceldata;
